package spring4;

import org.aspectj.lang.ProceedingJoinPoint;

/*
 * <aop:aspect>大多用于日志、缓存
 * <aop:aspect>定义切面（包括通知（前置通知，后置通知，返回通知等等）和切点（pointcut））
 */

public class AspectAdvice {

	public void beforeAdvice() {
		System.out.println("BeforeAdvice method starts…");
	}

	public void afterAdvice() {
		System.out.println("AfterAdvice method return…");

	}

	public void afterReturningAdvice() {
		System.out.println("AfterReturningAdvice method return…");

	}

	public Object aroundAdvice(ProceedingJoinPoint joinPoint) throws Throwable {
		System.out.println("AroundAdvice method starts…");
		Object result = joinPoint.proceed();
		System.out.println("AroundAdvice method return…");
		return result;
	}

	public void afterThrowing() {
		System.out.println("ThrowAdvice afterThrowing …");
	}

}
